<script>window.location.href='http://wx.12301.cc/html/terminal.html';</script>
<?
if(isset($_SESSION['memberID'])){
    echo "<script>window.location.href='/terminal.html';</script>";
    exit;
}
?>

<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
    <title>验票系统--商户登录</title>
    <link rel="stylesheet" href="css/gumby.css">
    <link rel="stylesheet" href="css/public.css">
</head>
<body>
    <div class="header">
        <h1 class="title">验票系统-用户登录</h1>
    </div>
    <div class="container">
        <div class="row">
            <div class="twelve columns">
                <fieldset>
                    <ul class="mt1">
                        <li class="field">
                            <labe for="loginName">账号：</labe>
                            <input type="text" placeholder="请输入商户ID或手机号" value="<?=$_COOKIE['account']?>" class="wide text input" name="loginName" id="loginName" />
                        </li>
                        <li class="field">
                            <labe for="loginPwd">密码：</labe>
                            <input type="password" placeholder="请输入您的密码" class="wide password input" name="loginPwd" id="loginPwd" />
                        </li>
                        <li class="field center-text">
                            <div class="pretty medium primary btn"><a href="javascript:;" id="btn_login">登  录</a></div>
                        </li>
                    </ul>
                </fieldset>
            </div>
        </div>
    </div>
    <div id='errtxt'></div>
    <div class="footer">
        <h1 class="title">&copy;票付通 版权所有</h1>
    </div>
    <script type="text/javascript" src="http://www.12301.cc/js/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="http://www.12301.cc/js/md5.js"></script>
    <script type="text/javascript">
        $(function(){
            $("#btn_login").on('click', function(){
                var a = $("#loginName").val(),
                    p = $("#loginPwd").val();
                if(!a.length) {
                    alert('请输入登录账号');
                    return false;
                }
                if(!p.length) {
                    alert('请输入密码');
                    return false;
                }
                var data = {
                    action:"login",
                    password:hex_md5(p),
                    account:a};
                $.post('jh/jh.php',data, function(res){
                    if(res.status!='ok') {
                        alert(res.msg);
                    } else {
                        location.href = "terminal.html";
                    }
                }, 'json');
            });
        });
    </script>
</body>
</html>